/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.camachosanchez.mechanics;

import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Graphics2D;

/**
 *
 * @author Rolando
 */
public class EjeES {

    private int posicion;
    private int x;
    private int y;
    private int alto;
    private int ancho;

    public EjeES(int x, int y, int ancho, int alto, int posicion) {
        this.x = x;
        this.y = y;
        this.alto = alto;
        this.ancho = ancho;
        this.posicion = posicion;
    }

    public int getAlto() {
        return alto;
    }

    public void setAlto(int alto) {
        this.alto = alto;
    }

    public int getAncho() {
        return ancho;
    }

    public void setAncho(int ancho) {
        this.ancho = ancho;
    }

    public int getPosicion() {
        return posicion;
    }

    public void setPosicion(int posicion) {
        this.posicion = posicion;
    }

    public int getX() {
        return x;
    }

    public void setX(int x) {
        this.x = x;
    }

    public int getY() {
        return y;
    }

    public void setY(int y) {
        this.y = y;
    }

    public void graficar(Graphics2D graphics) {
        graphics.setColor(Color.white);
//        float dash[] = {2.0f};
//        graphics.setStroke(new BasicStroke(1.0f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 10.0f, dash, 0.0f));
        graphics.fillRoundRect(x + 2, y + 2, ancho - 4, alto - 4, 8, 8);
        graphics.setColor(Color.black);
        graphics.drawRoundRect(x + 2, y + 2, ancho - 4, alto - 4, 8, 8);
        graphics.setColor(Color.red);
        graphics.setStroke(new BasicStroke());
        int xCentro = x + (ancho / 2);
        int yCentro = y + (alto / 2);
        int k = 2;
        graphics.drawLine(xCentro - k, yCentro - k, xCentro + k, yCentro + k);
        graphics.drawLine(xCentro - k, yCentro + k, xCentro + k, yCentro - k);
    }
}
